//
//  CTHomeViewController.m
//  jdforme
//
//  Created by leo on 2017/5/18.
//  Copyright © 2017年 leojingdong.com. All rights reserved.
//
#define HomePageUrl @"http://m.jd.com/?cu=true&utm_source=shenma-pinzhuan&utm_medium=cpc&utm_campaign=t_288551095_shenmapinzhuan&amp;utm_term=457da7d9c3fa45ebb2ead137d42333bb_0_1d3ddf95605e417280d9b9145f7beb4e"
#import "CTHomeViewController.h"
#import "CTSearchBar.h"
@interface CTHomeViewController ()

@end

@implementation CTHomeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setNavigationBar];
    self.view.backgroundColor = [UIColor whiteColor];
    UIWebView *homeView = [[UIWebView alloc] initWithFrame:self.view.bounds];
    //根据屏幕大小设置尺寸
    homeView.scalesPageToFit = YES;
    [self.view addSubview:homeView];
    //请求页面
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:HomePageUrl]];
    [homeView loadRequest:request];
    
}
- (void)setNavigationBar {
    CTSearchBar *searchBar = [[CTSearchBar alloc] init];
    searchBar.placeholder = @"二狗子震撼五杀";
    [self.navigationController.navigationBar addSubview:searchBar];
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
